<?php


namespace App\Transformers;


use League\Fractal\TransformerAbstract;

class PromoterLevelTransFormer extends TransformerAbstract
{
    public function transform($data)
    {
        return [
            'id' => $data->id,
            'position' => $data->position ?? '',
            'image' => $data->image ?? '',
            'level' => $data->level ?? '',
            'first_commission' => $data->first_commission ?? '',
            'second_commission' => $data->second_commission ?? '',
            'is_show' => $data->is_show ?? '',
            'user_id' => $data->user_id ?? '',
            'promoter_id' => $data->promoter_id ?? '',
            'created_at' => $data->created_at ? $data->created_at->format("Y-m-d H:i:s") : '',
            'updated_at' => $data->updated_at ? $data->updated_at->format("Y-m-d H:i:s") : '',
        ];
    }
}
